package org.lgh.wallet.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.lgh.wallet.common.R;
import org.lgh.wallet.dto.ConsumeDTO;
import org.lgh.wallet.dto.DrawbackDTO;
import org.lgh.wallet.entity.Wallet;

/**
 * @author wei-xhh
 * @date 2023-02-27
 */
public interface WalletService extends IService<Wallet>  {
    /**
     * 根据用户ID查询钱包
     * @param userId 用户ID
     * @return
     */
    R<Object> getByUserId(Long userId);

    /**
     * 用户消费
     * @param param
     * @return
     */
    R<Object> consume(ConsumeDTO param);

    /**
     * 用户退款
     * @param param
     * @return
     */
    R<Object> drawback(DrawbackDTO param);

    /**
     * 根据钱包ID获取明细
     * @param walletId 用户钱包ID
     * @return
     */
    R<Object> getDetail(Long walletId);
}
